package com.zmn.oms.model.dto.conf.treenode;

import com.zmn.consts.GlobalConsts;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 类描述：select下拉框树节点对象
 *
 * @description
 * @author tanbiao
 * @modifier
 * @since 2020/9/11 16:00
 **/
@Data
public class TreeNodeDTO implements Serializable {

	private static final long serialVersionUID = 8109707976378326003L;

	/**
	 * 名称
	 */
	private String name;

	/**
	 * 值
	 */
	private Integer value;

	/**
	 * 是否选中
	 */
	private boolean selected;

    /**
     * 是否禁用
     */
	private boolean disabled;

	/**
	 * 子节点
	 */
	private List<TreeNodeDTO> children = new ArrayList<>(GlobalConsts.NO);

	public TreeNodeDTO(String name, Integer value) {
		this.name = name;
		this.value = value;
	}

	public TreeNodeDTO(String name, Integer value, boolean selected) {
		this.name = name;
		this.value = value;
		this.selected = selected;
	}

	public TreeNodeDTO(String name, Integer value, boolean selected, boolean disabled) {
		this.name = name;
		this.value = value;
		this.selected = selected;
		this.disabled = disabled;
	}

	public TreeNodeDTO() {
	}
}
